package com.freight.base.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.freight.core.common.utils.PageUtil;
import com.freight.core.common.utils.ResultUtil;
import com.freight.core.common.vo.PageVo;
import com.freight.core.common.vo.Result;
import com.freight.core.entity.OperationLog;
import com.freight.core.service.OperationLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Api(description = "操作记录接口")
@RequestMapping("/freight/operationLog")
@RestController
@Slf4j
public class OperationLogController {

    @Autowired
    private OperationLogService operationLogService;

    @RequestMapping(value = "/getOperationLogList", method = RequestMethod.POST)
    @ApiOperation(value = "操作记录列表")
    public Result<IPage<OperationLog>> getOperationLogList(PageVo page, Integer logType, Integer oid) {
        IPage<OperationLog> res =  operationLogService.getOperationLogList(PageUtil.initMpPage(page),logType,oid);
        return  new ResultUtil<IPage<OperationLog>>().setData(res);
    }

}
